<%@page import="java.util.List"%>
<%@page import="modulo1.cdp.Professor"%>
<%@page import="modulo1.cdp.Turma"%>
<%@include file="inc/inicio.jsp" %>
<div class="table" style="border-top:2px solid #f70;">
    <br />
    <form method="post" id="evento">
        <input type="hidden" name="evento" value="professor" />                
        <a class="button" style="cursor: pointer;" onclick="history.back(-1)">Voltar</a><br />
        <table class="listing form" cellpadding="0" cellspacing="0">
            <tr>
                <th class="first" width="70%">Nome</th>
                <th>Adicionar</th>                
            </tr>
            <%
                int bg = 1;
                List<Professor> lista = (List<Professor>) request.getAttribute("professores");
                for (int i = 0; i < lista.size(); i++) {
            %>
            <tr <%=(bg == 1) ? "class=\"bg\"" : ""%>>
                <td class="first style1"><%=lista.get(i).getNome()%></td>
                <td><a class="btnAcao" value="<%=lista.get(i).getId()%>"  style="cursor: pointer;"><img src="img/admin-template/add-icon.gif" width="16" height="16" alt="" /></a></td>

            </tr>
            <% }%>         
        </table>
        <input type="hidden" id="professor" name="professor" />
        <input type="hidden" id="turma" name="turma" value="<%=request.getParameter("id")%>" />
        <p>&nbsp;</p>
    </form>
</div>
<script>
    $('.btnAcao').click(function(){        
        $('#professor').attr("value",$(this).attr("value"));
        $('#evento').submit();
    });
</script>
<%@include file="inc/fim.jsp" %>